Optimal. Leaf size=147 \[ \frac {(A-3 B) x}{a^3}-\frac {(7 A-27 B) \sin (c+d x)}{15 a^3 d}+\frac {(A-B) \cos ^3(c+d x) \sin (c+d x)}{5 d (a+a \cos (c+d x))^3}+\frac {(4 A-9 B) \cos ^2(c+d x) \sin (c+d x)}{15 a d (a+a \cos (c+d x))^2}-\frac {(A-3 B) \sin (c+d x)}{d \left (a^3+a^3 \cos (c+d x)\right )} \]
[Out]
________________________________________________________________________________________
Rubi [A]
time = 0.29, antiderivative size = 147, normalized size of antiderivative = 1.00, number of steps
used = 7, number of rules used = 6, integrand size = 31, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.194, Rules used = {3056, 3047,
3102, 12, 2814, 2727} \begin {gather*} -\frac {(7 A-27 B) \sin (c+d x)}{15 a^3 d}-\frac {(A-3 B) \sin (c+d x)}{d \left (a^3 \cos (c+d x)+a^3\right )}+\frac {x (A-3 B)}{a^3}+\frac {(A-B) \sin (c+d x) \cos ^3(c+d x)}{5 d (a \cos (c+d x)+a)^3}+\frac {(4 A-9 B) \sin (c+d x) \cos ^2(c+d x)}{15 a d (a \cos (c+d x)+a)^2} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
Rule 12
Rule 2727
Rule 2814
Rule 3047
Rule 3056
Rule 3102
Rubi steps
\begin {align*} \int \frac {\cos ^3(c+d x) (A+B \cos (c+d x))}{(a+a \cos (c+d x))^3} \, dx &=\frac {(A-B) \cos ^3(c+d x) \sin (c+d x)}{5 d (a+a \cos (c+d x))^3}+\frac {\int \frac {\cos ^2(c+d x) (3 a (A-B)-a (A-6 B) \cos (c+d x))}{(a+a \cos (c+d x))^2} \, dx}{5 a^2}\\ &=\frac {(A-B) \cos ^3(c+d x) \sin (c+d x)}{5 d (a+a \cos (c+d x))^3}+\frac {(4 A-9 B) \cos ^2(c+d x) \sin (c+d x)}{15 a d (a+a \cos (c+d x))^2}+\frac {\int \frac {\cos (c+d x) \left (2 a^2 (4 A-9 B)-a^2 (7 A-27 B) \cos (c+d x)\right )}{a+a \cos (c+d x)} \, dx}{15 a^4}\\ &=\frac {(A-B) \cos ^3(c+d x) \sin (c+d x)}{5 d (a+a \cos (c+d x))^3}+\frac {(4 A-9 B) \cos ^2(c+d x) \sin (c+d x)}{15 a d (a+a \cos (c+d x))^2}+\frac {\int \frac {2 a^2 (4 A-9 B) \cos (c+d x)-a^2 (7 A-27 B) \cos ^2(c+d x)}{a+a \cos (c+d x)} \, dx}{15 a^4}\\ &=-\frac {(7 A-27 B) \sin (c+d x)}{15 a^3 d}+\frac {(A-B) \cos ^3(c+d x) \sin (c+d x)}{5 d (a+a \cos (c+d x))^3}+\frac {(4 A-9 B) \cos ^2(c+d x) \sin (c+d x)}{15 a d (a+a \cos (c+d x))^2}+\frac {\int \frac {15 a^3 (A-3 B) \cos (c+d x)}{a+a \cos (c+d x)} \, dx}{15 a^5}\\ &=-\frac {(7 A-27 B) \sin (c+d x)}{15 a^3 d}+\frac {(A-B) \cos ^3(c+d x) \sin (c+d x)}{5 d (a+a \cos (c+d x))^3}+\frac {(4 A-9 B) \cos ^2(c+d x) \sin (c+d x)}{15 a d (a+a \cos (c+d x))^2}+\frac {(A-3 B) \int \frac {\cos (c+d x)}{a+a \cos (c+d x)} \, dx}{a^2}\\ &=\frac {(A-3 B) x}{a^3}-\frac {(7 A-27 B) \sin (c+d x)}{15 a^3 d}+\frac {(A-B) \cos ^3(c+d x) \sin (c+d x)}{5 d (a+a \cos (c+d x))^3}+\frac {(4 A-9 B) \cos ^2(c+d x) \sin (c+d x)}{15 a d (a+a \cos (c+d x))^2}-\frac {(A-3 B) \int \frac {1}{a+a \cos (c+d x)} \, dx}{a^2}\\ &=\frac {(A-3 B) x}{a^3}-\frac {(7 A-27 B) \sin (c+d x)}{15 a^3 d}+\frac {(A-B) \cos ^3(c+d x) \sin (c+d x)}{5 d (a+a \cos (c+d x))^3}+\frac {(4 A-9 B) \cos ^2(c+d x) \sin (c+d x)}{15 a d (a+a \cos (c+d x))^2}-\frac {(A-3 B) \sin (c+d x)}{d \left (a^3+a^3 \cos (c+d x)\right )}\\ \end {align*}
________________________________________________________________________________________
Mathematica [B] Leaf count is larger than twice the leaf count of optimal. \(361\) vs. \(2(147)=294\).
time = 0.98, size = 361, normalized size = 2.46 \begin {gather*} \frac {\cos \left (\frac {1}{2} (c+d x)\right ) \sec \left (\frac {c}{2}\right ) \left (300 (A-3 B) d x \cos \left (\frac {d x}{2}\right )+300 (A-3 B) d x \cos \left (c+\frac {d x}{2}\right )+150 A d x \cos \left (c+\frac {3 d x}{2}\right )-450 B d x \cos \left (c+\frac {3 d x}{2}\right )+150 A d x \cos \left (2 c+\frac {3 d x}{2}\right )-450 B d x \cos \left (2 c+\frac {3 d x}{2}\right )+30 A d x \cos \left (2 c+\frac {5 d x}{2}\right )-90 B d x \cos \left (2 c+\frac {5 d x}{2}\right )+30 A d x \cos \left (3 c+\frac {5 d x}{2}\right )-90 B d x \cos \left (3 c+\frac {5 d x}{2}\right )-740 A \sin \left (\frac {d x}{2}\right )+1755 B \sin \left (\frac {d x}{2}\right )+540 A \sin \left (c+\frac {d x}{2}\right )-1125 B \sin \left (c+\frac {d x}{2}\right )-460 A \sin \left (c+\frac {3 d x}{2}\right )+1215 B \sin \left (c+\frac {3 d x}{2}\right )+180 A \sin \left (2 c+\frac {3 d x}{2}\right )-225 B \sin \left (2 c+\frac {3 d x}{2}\right )-128 A \sin \left (2 c+\frac {5 d x}{2}\right )+363 B \sin \left (2 c+\frac {5 d x}{2}\right )+75 B \sin \left (3 c+\frac {5 d x}{2}\right )+15 B \sin \left (3 c+\frac {7 d x}{2}\right )+15 B \sin \left (4 c+\frac {7 d x}{2}\right )\right )}{120 a^3 d (1+\cos (c+d x))^3} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
Maple [A]
time = 0.18, size = 134, normalized size = 0.91
method | result | size |
derivativedivides | \(\frac {-\frac {A \left (\tan ^{5}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{5}+\frac {B \left (\tan ^{5}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{5}+\frac {4 \left (\tan ^{3}\left (\frac {d x}{2}+\frac {c}{2}\right )\right ) A}{3}-2 \left (\tan ^{3}\left (\frac {d x}{2}+\frac {c}{2}\right )\right ) B -7 A \tan \left (\frac {d x}{2}+\frac {c}{2}\right )+17 B \tan \left (\frac {d x}{2}+\frac {c}{2}\right )+\frac {8 B \tan \left (\frac {d x}{2}+\frac {c}{2}\right )}{1+\tan ^{2}\left (\frac {d x}{2}+\frac {c}{2}\right )}+8 \left (A -3 B \right ) \arctan \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{4 d \,a^{3}}\) | \(134\) |
default | \(\frac {-\frac {A \left (\tan ^{5}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{5}+\frac {B \left (\tan ^{5}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{5}+\frac {4 \left (\tan ^{3}\left (\frac {d x}{2}+\frac {c}{2}\right )\right ) A}{3}-2 \left (\tan ^{3}\left (\frac {d x}{2}+\frac {c}{2}\right )\right ) B -7 A \tan \left (\frac {d x}{2}+\frac {c}{2}\right )+17 B \tan \left (\frac {d x}{2}+\frac {c}{2}\right )+\frac {8 B \tan \left (\frac {d x}{2}+\frac {c}{2}\right )}{1+\tan ^{2}\left (\frac {d x}{2}+\frac {c}{2}\right )}+8 \left (A -3 B \right ) \arctan \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{4 d \,a^{3}}\) | \(134\) |
risch | \(\frac {x A}{a^{3}}-\frac {3 B x}{a^{3}}-\frac {i {\mathrm e}^{i \left (d x +c \right )} B}{2 a^{3} d}+\frac {i {\mathrm e}^{-i \left (d x +c \right )} B}{2 a^{3} d}-\frac {2 i \left (45 A \,{\mathrm e}^{4 i \left (d x +c \right )}-90 B \,{\mathrm e}^{4 i \left (d x +c \right )}+135 A \,{\mathrm e}^{3 i \left (d x +c \right )}-300 B \,{\mathrm e}^{3 i \left (d x +c \right )}+185 A \,{\mathrm e}^{2 i \left (d x +c \right )}-420 B \,{\mathrm e}^{2 i \left (d x +c \right )}+115 A \,{\mathrm e}^{i \left (d x +c \right )}-270 B \,{\mathrm e}^{i \left (d x +c \right )}+32 A -72 B \right )}{15 d \,a^{3} \left ({\mathrm e}^{i \left (d x +c \right )}+1\right )^{5}}\) | \(178\) |
norman | \(\frac {\frac {\left (A -3 B \right ) x}{a}+\frac {\left (A -3 B \right ) x \left (\tan ^{8}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{a}+\frac {4 \left (A -3 B \right ) x \left (\tan ^{2}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{a}+\frac {6 \left (A -3 B \right ) x \left (\tan ^{4}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{a}+\frac {4 \left (A -3 B \right ) x \left (\tan ^{6}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{a}-\frac {\left (A -B \right ) \left (\tan ^{13}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{20 d a}+\frac {\left (4 A -9 B \right ) \left (\tan ^{11}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{30 d a}-\frac {\left (7 A -25 B \right ) \tan \left (\frac {d x}{2}+\frac {c}{2}\right )}{4 d a}-\frac {5 \left (8 A -27 B \right ) \left (\tan ^{3}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{6 d a}-\frac {\left (26 A -81 B \right ) \left (\tan ^{7}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{5 d a}-\frac {\left (43 A -153 B \right ) \left (\tan ^{9}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{60 d a}-\frac {\left (553 A -1773 B \right ) \left (\tan ^{5}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{60 d a}}{\left (1+\tan ^{2}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )^{4} a^{2}}\) | \(296\) |
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Maxima [A]
time = 0.48, size = 231, normalized size = 1.57 \begin {gather*} \frac {3 \, B {\left (\frac {40 \, \sin \left (d x + c\right )}{{\left (a^{3} + \frac {a^{3} \sin \left (d x + c\right )^{2}}{{\left (\cos \left (d x + c\right ) + 1\right )}^{2}}\right )} {\left (\cos \left (d x + c\right ) + 1\right )}} + \frac {\frac {85 \, \sin \left (d x + c\right )}{\cos \left (d x + c\right ) + 1} - \frac {10 \, \sin \left (d x + c\right )^{3}}{{\left (\cos \left (d x + c\right ) + 1\right )}^{3}} + \frac {\sin \left (d x + c\right )^{5}}{{\left (\cos \left (d x + c\right ) + 1\right )}^{5}}}{a^{3}} - \frac {120 \, \arctan \left (\frac {\sin \left (d x + c\right )}{\cos \left (d x + c\right ) + 1}\right )}{a^{3}}\right )} - A {\left (\frac {\frac {105 \, \sin \left (d x + c\right )}{\cos \left (d x + c\right ) + 1} - \frac {20 \, \sin \left (d x + c\right )^{3}}{{\left (\cos \left (d x + c\right ) + 1\right )}^{3}} + \frac {3 \, \sin \left (d x + c\right )^{5}}{{\left (\cos \left (d x + c\right ) + 1\right )}^{5}}}{a^{3}} - \frac {120 \, \arctan \left (\frac {\sin \left (d x + c\right )}{\cos \left (d x + c\right ) + 1}\right )}{a^{3}}\right )}}{60 \, d} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Fricas [A]
time = 0.34, size = 165, normalized size = 1.12 \begin {gather*} \frac {15 \, {\left (A - 3 \, B\right )} d x \cos \left (d x + c\right )^{3} + 45 \, {\left (A - 3 \, B\right )} d x \cos \left (d x + c\right )^{2} + 45 \, {\left (A - 3 \, B\right )} d x \cos \left (d x + c\right ) + 15 \, {\left (A - 3 \, B\right )} d x + {\left (15 \, B \cos \left (d x + c\right )^{3} - {\left (32 \, A - 117 \, B\right )} \cos \left (d x + c\right )^{2} - 3 \, {\left (17 \, A - 57 \, B\right )} \cos \left (d x + c\right ) - 22 \, A + 72 \, B\right )} \sin \left (d x + c\right )}{15 \, {\left (a^{3} d \cos \left (d x + c\right )^{3} + 3 \, a^{3} d \cos \left (d x + c\right )^{2} + 3 \, a^{3} d \cos \left (d x + c\right ) + a^{3} d\right )}} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Sympy [B] Leaf count of result is larger than twice the leaf count of optimal. 496 vs.
\(2 (134) = 268\).
time = 2.72, size = 496, normalized size = 3.37 \begin {gather*} \begin {cases} \frac {60 A d x \tan ^{2}{\left (\frac {c}{2} + \frac {d x}{2} \right )}}{60 a^{3} d \tan ^{2}{\left (\frac {c}{2} + \frac {d x}{2} \right )} + 60 a^{3} d} + \frac {60 A d x}{60 a^{3} d \tan ^{2}{\left (\frac {c}{2} + \frac {d x}{2} \right )} + 60 a^{3} d} - \frac {3 A \tan ^{7}{\left (\frac {c}{2} + \frac {d x}{2} \right )}}{60 a^{3} d \tan ^{2}{\left (\frac {c}{2} + \frac {d x}{2} \right )} + 60 a^{3} d} + \frac {17 A \tan ^{5}{\left (\frac {c}{2} + \frac {d x}{2} \right )}}{60 a^{3} d \tan ^{2}{\left (\frac {c}{2} + \frac {d x}{2} \right )} + 60 a^{3} d} - \frac {85 A \tan ^{3}{\left (\frac {c}{2} + \frac {d x}{2} \right )}}{60 a^{3} d \tan ^{2}{\left (\frac {c}{2} + \frac {d x}{2} \right )} + 60 a^{3} d} - \frac {105 A \tan {\left (\frac {c}{2} + \frac {d x}{2} \right )}}{60 a^{3} d \tan ^{2}{\left (\frac {c}{2} + \frac {d x}{2} \right )} + 60 a^{3} d} - \frac {180 B d x \tan ^{2}{\left (\frac {c}{2} + \frac {d x}{2} \right )}}{60 a^{3} d \tan ^{2}{\left (\frac {c}{2} + \frac {d x}{2} \right )} + 60 a^{3} d} - \frac {180 B d x}{60 a^{3} d \tan ^{2}{\left (\frac {c}{2} + \frac {d x}{2} \right )} + 60 a^{3} d} + \frac {3 B \tan ^{7}{\left (\frac {c}{2} + \frac {d x}{2} \right )}}{60 a^{3} d \tan ^{2}{\left (\frac {c}{2} + \frac {d x}{2} \right )} + 60 a^{3} d} - \frac {27 B \tan ^{5}{\left (\frac {c}{2} + \frac {d x}{2} \right )}}{60 a^{3} d \tan ^{2}{\left (\frac {c}{2} + \frac {d x}{2} \right )} + 60 a^{3} d} + \frac {225 B \tan ^{3}{\left (\frac {c}{2} + \frac {d x}{2} \right )}}{60 a^{3} d \tan ^{2}{\left (\frac {c}{2} + \frac {d x}{2} \right )} + 60 a^{3} d} + \frac {375 B \tan {\left (\frac {c}{2} + \frac {d x}{2} \right )}}{60 a^{3} d \tan ^{2}{\left (\frac {c}{2} + \frac {d x}{2} \right )} + 60 a^{3} d} & \text {for}\: d \neq 0 \\\frac {x \left (A + B \cos {\left (c \right )}\right ) \cos ^{3}{\left (c \right )}}{\left (a \cos {\left (c \right )} + a\right )^{3}} & \text {otherwise} \end {cases} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Giac [A]
time = 0.43, size = 155, normalized size = 1.05 \begin {gather*} \frac {\frac {60 \, {\left (d x + c\right )} {\left (A - 3 \, B\right )}}{a^{3}} + \frac {120 \, B \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )}{{\left (\tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{2} + 1\right )} a^{3}} - \frac {3 \, A a^{12} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{5} - 3 \, B a^{12} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{5} - 20 \, A a^{12} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{3} + 30 \, B a^{12} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{3} + 105 \, A a^{12} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) - 255 \, B a^{12} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )}{a^{15}}}{60 \, d} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Mupad [B]
time = 0.26, size = 152, normalized size = 1.03 \begin {gather*} \frac {{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^3\,\left (\frac {A-B}{6\,a^3}+\frac {2\,A-4\,B}{12\,a^3}\right )}{d}-\frac {\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )\,\left (\frac {3\,\left (A-B\right )}{4\,a^3}-\frac {3\,B}{2\,a^3}+\frac {2\,A-4\,B}{2\,a^3}\right )}{d}+\frac {x\,\left (A-3\,B\right )}{a^3}+\frac {2\,B\,\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}{d\,\left (a^3\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^2+a^3\right )}-\frac {{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^5\,\left (A-B\right )}{20\,a^3\,d} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________